package com.example.springbootsenior.task.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @classDesc: 功能描述:异步任务
 * @author: 李明杰
 * @date: 2021/11/20 15:05
 * @copyright
 */
@Service
public class AsyncService {
    @Async//这是一个异步方法
    public void hello() {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("数据处理中");
    }
}
